package com.lzy.cloud.order.service.impl;

import com.lzy.cloud.order.dtos.OrderAssessDto;
import com.lzy.cloud.order.entity.OrderAssess;
import com.lzy.cloud.order.entity.OrderRefundLog;
import com.lzy.cloud.order.mapper.OrderAssessMapperExt;
import com.lzy.cloud.order.service.OrderAssessService;
import com.lzy.framework.core.utils.DozerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description:订单评论
 * @author: liyun
 * @create: 2018-07-06 16:24
 */
@Service
public class OrderAssessServiceImpl implements OrderAssessService {
    @Autowired
    private OrderAssessMapperExt orderAssessMapperExt;

    @Override
    public OrderAssessDto queryByOrderId(String orderId) {
        return orderAssessMapperExt.queryByOrderId(orderId);
    }

    @Override
    public Long create(OrderAssessDto orderAssessDto) {
        OrderAssess orderAssess = DozerUtils.map(orderAssessDto, OrderAssess.class);
        return orderAssessMapperExt.insertSelective(orderAssess)>0 ? orderAssess.getId() : 0;
    }
}
